import { Body, Controller, Get, Param, Post, Query } from '@nestjs/common';
import { RoleEntity } from '../entity/role.entity';
import { Index } from '../emr_imp';
import { Tableobj } from '../entity/tableobj';


@Controller()
export class RoleController {

  constructor(
    private readonly baseindex:Index,
  ) {
  }

  /*
  *所有查询操作集合
  */
  @Get('role/getallroles')
  async getallroles():Promise<RoleEntity[]>
  {
     return await this.baseindex.getallroles();
  }

  @Get('role/getalltexts')
  async getalltexts():Promise<any[]>
  {
    return await this.baseindex.getalltext();
  }

  @Get('role/getalltextbyname')
  async getalltextbyname(@Query('textname') textname:string):Promise<any[]>
  {
     return await this.baseindex.getalltextbyname(textname);
  }

}